<template>
	<view class="content">
		<view class="rows" :class=" index == 2 || index == 6 ? 'splite':'' " v-for="(item,index) in data" :key="index" @tap="tapThis(index)" v-show="index !== 7">
			<view class="left">{{item.leftName}}</view>
			<uni-icons class="icon" type="arrowright"  color="#30313B" size="12" v-if="index !== 6 && index !== 7 " />
			<view class="right">{{item.rightName}}</view>
			<view class="clearBoth"></view>
		</view>
	</view>
</template>
<style>
	.content{min-height: 100vh;background: rgb(245,245,249);}
	.content .rows{width:100%;padding:4% 5%;border-bottom:2upx solid #F2F2F5;background: white;}
	.content .splite{border-bottom: 20upx solid rgb(245,245,249);}
	.content .rows .left{float: left;color:#30313B;font-size: 32upx;}
	.content .rows .right{float: right;color:#30313B;font-size: 32upx;}
	.content .rows .icon{float: right;margin-top: 6upx;margin-left: 20upx;}
</style>
<script>
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	import uniSection from '@/components/uni-section/uni-section.vue'
	import Share from '@/common/wx_share.js'
	export default {
		components:{
			uniIcons,
			uniSection
		},
		data() {
			return {
				share:{
					title:"",
					path:'/pages/tabbar/mine',
					imageUrl:'',
					desc:'',
					content:''
				},
				tel:"1",
				data:[
					{"leftName":"更换绑定手机号","rightName":""},
					{"leftName":"设置登录密码","rightName":""},
					{"leftName":"钱包支付密码设置","rightName":""},
					{"leftName":"使用帮助","rightName":""},
					{"leftName":"意见反馈","rightName":""},
					{"leftName":"关于单领优品","rightName":""},
					{"leftName":"客服电话","rightName":""},
					{"leftName":"版本信息","rightName":""},
					{"leftName":"清除缓存","rightName":""},
					// {"leftName":"检查更新","rightName":""},
				],
			}
		},
		onLoad(){
			this.AjaxLoad();
		},
		methods: {
			AjaxLoad(){
				// this.data[6].rightName = "12321321321"
				// this.data[7].rightName = "V 10.0.0"
				let paramsA={
					token:this._$userToken("userInfo").token,
				};
				this._$InitRequest.request("MemberInfo/get_contact_us", paramsA).then(res => {
					this.data[6].rightName = res.data.contact_us
				},error=>{})
			},
			tapThis(e){
				var that = this;
				if( e == 0 ){
					uni.navigateTo({
						url:"/pages_mine/pages/changeTel/changeTel"
					})
				}else if( e == 1 ){
					uni.navigateTo({
						url:"/pages_mine/pages/set_setLoginPw/set_setLoginPw"
					})
				}else if( e == 2 ){
					uni.navigateTo({
						url:"/pages_mine/pages/set_password_page/set_password_page"
					})
				}else if( e == 3 ){
					uni.navigateTo({
						url:"/pages_mine/pages/set_help/set_help"
					})
				}else if( e == 4 ){
					uni.navigateTo({
						url:"/pages_mine/pages/set_Feedback/set_Feedback"
					})
				}else if( e == 5 ){
					uni.navigateTo({
						url:"/pages_mine/pages/set_about/set_about"
					})
				}else if( e == 6 ){
					uni.makePhoneCall({
					    phoneNumber:that.data[6].rightName,
						success: (res) => {
							console.log('成功!')
						},
						fail: (res) => {
							console.log('失败!')
						}
					});
				}else if( e == 7 ){
					
				}else if( e == 8 ){
					uni.showToast({icon:"none",title:"清除成功"})
				}
			},
			
		}
	}
</script>